//
//  MCPullMenuTableViewCell.m
//  TLYLSF
//
//  Created by Canny on 2017/6/7.
//  Copyright © 2017年 MC. All rights reserved.
//

#import "MCPullMenuTableViewCell.h"

#define COLOR_BACK [UIColor colorWithRed:85/255.0 green:153/255.0 blue:229/255.0 alpha:1.0]

@interface MCPullMenuTableViewCell ()


@end
@implementation MCPullMenuTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        [self initView];
    }
    return self;
}

- (void)initView{

    
    self.backgroundColor=COLOR_BACK;
    
    _lab_type= [UILabel new];
    _lab_type.layer.cornerRadius=5;
    _lab_type.backgroundColor = COLOR_BACK;
    _lab_type.layer.masksToBounds = YES;
    _lab_type.layer.borderWidth = 1;
    _lab_type.textColor=[UIColor whiteColor];
    _lab_type.layer.borderColor = [UIColor whiteColor].CGColor;
    _lab_type.font = [UIFont systemFontOfSize:15];
    _lab_type.numberOfLines=1;
    _lab_type.text = @"加载中...";
    _lab_type.textAlignment=NSTextAlignmentCenter;
    [self addSubview:_lab_type];
    [_lab_type mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(self.mas_centerX);
        make.centerY.equalTo(self.mas_centerY);
        make.width.mas_equalTo(75);
        make.height.mas_equalTo(25);
        
    }];
    
}

+(CGFloat)computeHeight:(id)info{
    return 35;
}
    
-(void)setDataSource:(id)dataSource{
    _dataSource=dataSource;
    _lab_type.text = [dataSource objectForKey:@"name"];
}
- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
    if (selected) {
        _lab_type.textColor=[UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0];
        _lab_type.layer.borderColor = [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0].CGColor;
    }else{
        _lab_type.textColor=[UIColor whiteColor];
        _lab_type.layer.borderColor = [UIColor whiteColor].CGColor;
    }
}


@end


























